package com.franzliszt.OrderOnline.Activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.franzliszt.OrderOnline.util.KillProcess;
import com.franzliszt.OrderOnline.util.SP;
import com.franzliszt.hospitalnumberingsystem.R;

public class PaySuccessActivity extends AppCompatActivity {
    private KillProcess killProcess;
    private String money;
    private SP sp;
    private TextView PaySuccessMoney;
    private TextView other;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (Build.VERSION.SDK_INT >= 21) {
            View decorView = getWindow().getDecorView();
            decorView.setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE );
            getWindow().setStatusBarColor( Color.TRANSPARENT );
        }
        setContentView(R.layout.activity_pay_success);
        InitView();
    }
    private void InitView(){
        other = findViewById(R.id.exchangeFunc);
        other.setText("历史记录");
        PaySuccessMoney = findViewById(R.id.PaySuccessMoney);
        killProcess = KillProcess.getInstance();
        killProcess.addActivity(PaySuccessActivity.this);
        sp = SP.getInstance();
        money = (String) sp.GetData(PaySuccessActivity.this,"TotalPrice","");
        PaySuccessMoney.setText(money);
    }


    public void ReturnMain(View view) {
        ReturnActivity(FunctionActivity.class);
    }
    public void Exit(View view) {
        ReturnActivity(FunctionActivity.class);
    }
    public void Exchange(View view) {
        ReturnActivity(HistoricalDataActivity.class);
    }
    private void ReturnActivity(Class activity)
    {startActivity(new Intent(PaySuccessActivity.this,activity));}
}
